<script setup>

import {getList, selectPage} from "@/api/system/apartment/erecord";
import da from "element-ui/src/locale/lang/da";


export default {
  data() {
    return {
      dialogVisible: false,
      queryParams: {
        type: "电表",
        number: "",
        pageNum: 1,
        pageSize: 10
      },
      total: 1,
      tableData: [],
    }
  }, methods: {
    resetQuery() {
      this.queryParams = {};
      this.resetForm("queryParams");
      this.queryMethods();
    },
    queryMethods() {
      let that = this;
      selectPage(that.queryParams).then(function (data) {
        console.log(data)
        that.tableData = data.data.list;
      })
    },
    handleSizeChange(pageSize) {
      this.queryParams.pageSize = pageSize;
      this.queryMethods();
    },
    handleCurrentChange(pageNum) {
      this.queryParams.pageNum = pageNum;
      this.queryMethods();
    },
  },
  created() {
    this.queryMethods();
    // getList(16).then(function (data) {
    //   console.log(data)
    // })
  }
}
</script>

<template>
  <div class="app-container">
    <el-form :model="queryParams" :inline="true">
      <el-form-item label="设备编号">
        <el-input
          v-model="queryParams.number"
          placeholder="设备编号"
          clearable
          size="small"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="queryMethods()">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="tableData"
      stripe
      style="width: 100%">
      <el-table-column
        prop="number"
        label="设备编号"
        align="center"
        width="210">
      </el-table-column>
      <el-table-column
        prop="address"
        label="设备位置"
        align="center"
        width="200">
      </el-table-column>
      <el-table-column
        prop="deductMoney"
        label="扣费金额"
        align="center"
        width="200">
      </el-table-column>
      <el-table-column
        prop="deductNumber"
        label="扣费数量"
        align="center"
        width="200">
      </el-table-column>
      <el-table-column
        prop="deductBeforeMoney"
        label="扣费前余额"
        align="center"
        width="200">
      </el-table-column>
      <el-table-column
        label="扣费前数量"
        prop="deductBeforeNumber"
        align="center"
        width="200">
      </el-table-column>
      <el-table-column
        prop="statisticalTime"
        label="统计时间"
        align="center"
        width="250">
      </el-table-column>
    </el-table>
  </div>
</template>

<style scoped lang="scss">

</style>
